package com.ruoyi.shop.ai.service.impl;

import com.ruoyi.shop.ai.AIHelper;
import com.ruoyi.shop.ai.service.IAiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: JinChen Zhu
 * @CreateTime: 2024-07-01  12:40
 */
@Service
@Slf4j
public class AiServiceImpl implements IAiService {
    @Autowired
    private AIHelper aiHelper;
    @Override
    public List<String> getAiResult(String text) {
        try {
            return aiHelper.abstractPoint(text);
        } catch (Exception e) {
            log.error("AI生成评论摘要失败，报错信息: ", e);
        }
        return null;
    }
}
